﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ur;

namespace Pixels.Logic.GameplayEvents
{
    public class StarvationEvent : GameplayEvent
    {
        int numToStarve = 0;

        internal override string getLongDescription() {
            return numToStarve.ToString() + " people died due to starvation!";
        }
     
        public StarvationEvent(int numToStarve) {
            this.numToStarve = numToStarve;
        }


        internal override void execute() {
            var arr = World.Colony.allColonists.ToArray();
            var toStarve = arr.randomSubset(numToStarve);
            foreach (var colonist in toStarve) colonist.die();
        }

    }
}
